Fix type import ordering#331
Merged
Merged
Conversation
1 task
byara
approved these changes
Dec 8, 2024
Collaborator
byara
left a comment
There was a problem hiding this comment.
Looks good @rsslldnphy and thank you for fixing this bug! Could you please add some snapshot tests for this case? After that, I'll merge this and we can release the fixes.
Contributor
Author
|
Sure thing, have done! Thanks :-) |
Contributor
Author
|
hmm not sure why it's failing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
it looks like #153 introduced a bug whereby
import type ...imports would no longer be sorted with their matching group even if a type-specific group was not present. (see #329 for more details). this pr changes the matching logic such that:THIRD_PARTY_TYPES_SPECIAL_WORDorTHIRD_PARTY_MODULES_SPECIAL_WORDgroups depending on the node type and whether theTHIRD_PARTY_TYPES_SPECIAL_WORDexists in the config.as this behaviour is starting to feel a little complex i've added a comment in the code - i see there's not a ton of comments so happy to take it out if it's against house style. i also don't love the code so refactoring suggestions welcomed.
this fixes #329 - i've tested it on my codebase and the incorrect ordering changes introduced by 5.0.0 were reversed.